//
//  UISettingsColorPickerViewController.m
//  vhStressECG
//
//  Created by jia yu on 2021/11/22.
//

#import "UISettingsColorPickerViewController.h"

@interface UISettingsColorPickerViewController (){
    UIPopoverPresentationController *pop;
}
@end

@implementation UISettingsColorPickerViewController
@synthesize fromView,fromViewRect;

-(void)setFromView:(UIView *)_fromView{
    fromView = _fromView;
    pop.sourceView = fromView;
}

-(void)setFromViewRect:(CGRect)_fromViewRect{
    fromViewRect = _fromViewRect;
    pop.sourceRect = fromViewRect;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor lightGrayColor];
}

#pragma mark - System Funcations
-(id)init{
    self = [super init];
    if (self){
        self.modalPresentationStyle = UIModalPresentationPopover;
        pop = self.popoverPresentationController;
        [pop setPermittedArrowDirections:UIPopoverArrowDirectionAny];
        pop.sourceView = self.view;
        pop.sourceRect = CGRectMake(100.f, 100.f, 30.f, 30.f);
    }
    return self;
}


//-(void)viewDidAppear:(BOOL)animated{
//    CGSize size =  CGSizeMake(720.f, 480.f);
//    [self setPreferredContentSize:size];
//    [super viewDidAppear:animated];
//}
@end
